Optimal. Leaf size=37 \[ \frac{b \tan ^{-1}\left (\frac{\sqrt{a+b} \cot (x)}{\sqrt{a}}\right )}{a^{3/2} \sqrt{a+b}}+\frac{\tan (x)}{a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0605322, antiderivative size = 37, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.2, Rules used = {3187, 453, 205} \[ \frac{b \tan ^{-1}\left (\frac{\sqrt{a+b} \cot (x)}{\sqrt{a}}\right )}{a^{3/2} \sqrt{a+b}}+\frac{\tan (x)}{a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3187
Rule 453
Rule 205
Rubi steps
\begin{align*} \int \frac{\sec ^2(x)}{a+b \cos ^2(x)} \, dx &=-\operatorname{Subst}\left (\int \frac{1+x^2}{x^2 \left (a+(a+b) x^2\right )} \, dx,x,\cot (x)\right )\\ &=\frac{\tan (x)}{a}+\frac{b \operatorname{Subst}\left (\int \frac{1}{a+(a+b) x^2} \, dx,x,\cot (x)\right )}{a}\\ &=\frac{b \tan ^{-1}\left (\frac{\sqrt{a+b} \cot (x)}{\sqrt{a}}\right )}{a^{3/2} \sqrt{a+b}}+\frac{\tan (x)}{a}\\ \end{align*}
Mathematica [A] time = 0.0743614, size = 38, normalized size = 1.03 \[ \frac{\tan (x)}{a}-\frac{b \tan ^{-1}\left (\frac{\sqrt{a} \tan (x)}{\sqrt{a+b}}\right )}{a^{3/2} \sqrt{a+b}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.028, size = 33, normalized size = 0.9 \begin{align*}{\frac{\tan \left ( x \right ) }{a}}-{\frac{b}{a}\arctan \left ({\tan \left ( x \right ) a{\frac{1}{\sqrt{ \left ( a+b \right ) a}}}} \right ){\frac{1}{\sqrt{ \left ( a+b \right ) a}}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.92837, size = 543, normalized size = 14.68 \begin{align*} \left [-\frac{\sqrt{-a^{2} - a b} b \cos \left (x\right ) \log \left (\frac{{\left (8 \, a^{2} + 8 \, a b + b^{2}\right )} \cos \left (x\right )^{4} - 2 \,{\left (4 \, a^{2} + 3 \, a b\right )} \cos \left (x\right )^{2} - 4 \,{\left ({\left (2 \, a + b\right )} \cos \left (x\right )^{3} - a \cos \left (x\right )\right )} \sqrt{-a^{2} - a b} \sin \left (x\right ) + a^{2}}{b^{2} \cos \left (x\right )^{4} + 2 \, a b \cos \left (x\right )^{2} + a^{2}}\right ) - 4 \,{\left (a^{2} + a b\right )} \sin \left (x\right )}{4 \,{\left (a^{3} + a^{2} b\right )} \cos \left (x\right )}, \frac{\sqrt{a^{2} + a b} b \arctan \left (\frac{{\left (2 \, a + b\right )} \cos \left (x\right )^{2} - a}{2 \, \sqrt{a^{2} + a b} \cos \left (x\right ) \sin \left (x\right )}\right ) \cos \left (x\right ) + 2 \,{\left (a^{2} + a b\right )} \sin \left (x\right )}{2 \,{\left (a^{3} + a^{2} b\right )} \cos \left (x\right )}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\sec ^{2}{\left (x \right )}}{a + b \cos ^{2}{\left (x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.12358, size = 49, normalized size = 1.32 \begin{align*} -\frac{b \arctan \left (\frac{a \tan \left (x\right )}{\sqrt{a^{2} + a b}}\right )}{\sqrt{a^{2} + a b} a} + \frac{\tan \left (x\right )}{a} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]